home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2006 November
/
PCWorld_2006-11_cd.bin
/
domacnost a kancelar
/
easytime
/
ETT.exe
/
reports
/
xslt
/
SummaryInvoiceGroupByTask.xsl
< prev
next >
Wrap
Extensible Markup Language
|
2006-08-18
|
5KB
|
158 lines
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css"></link>
</head>
<xsl:apply-templates select="/Report/HeaderInfo"></xsl:apply-templates>
<xsl:apply-templates select="/Report/Customer"></xsl:apply-templates>
<xsl:apply-templates select="/Report/Customer/Project" mode="customer-project"/>
<xsl:apply-templates select="/Report/Customer/Tax"></xsl:apply-templates>
<xsl:apply-templates select="/Report/Customer/Total"/>
</html>
</xsl:template>
<xsl:template match="HeaderInfo">
<table class="TableSB" align="center" width="70%">
<tr>
<td class="TableSB">
<table class="TableSB" width="100%" cellpadding="2" cellspacing="0" >
<tr>
<td colspan="2" align="center" class="ReportTitleClass">Invoice# <xsl:value-of select="InvoiceNumber"/></td>
</tr>
<xsl:if test="Date">
<tr>
<td colspan="2" align="center" class="Date"><xsl:value-of select="Date/From"/> - <xsl:value-of select="Date/To"/></td>
</tr>
</xsl:if>
</table>
</td>
</tr>
</table>
</xsl:template>
<xsl:template match="/Report/Customer/Tax">
<table style="TableSB" width="70%" align="center">
<tr>
<td width="60%" class="SubTotal">Tax (<xsl:value-of select="Percent"/>%)</td>
<td width="40%" class="DetailRowDataClass1"><xsl:value-of select="Value"/></td>
</tr>
</table>
</xsl:template>
<xsl:template match="/Report/Customer/Total">
<table style="TableSB" width="70%" align="center">
<tr>
<td width="60%" class="Total">Total:</td>
<td class="Total"><xsl:value-of select="text()"/></td>
</tr>
</table>
</xsl:template>
<xsl:template match="Projects/Project">
<xsl:value-of select="text()"/>
<xsl:if test="following-sibling::*/text()">, </xsl:if>
</xsl:template>
<xsl:template match="Tasks/Task">
<xsl:value-of select="text()"/>
<xsl:if test="following-sibling::*/text()">, </xsl:if>
</xsl:template>
<xsl:template match="Customer">
<table align="center" width="70%">
<tr>
<td class="DetailRowTitleClass">Bill to:</td>
</tr>
<tr>
<td class="DetailRowDataClass"><xsl:value-of select="Name"/></td>
</tr>
<xsl:if test="Address">
<tr>
<td class="DetailRowDataClass" width="100%"><xsl:value-of select="Address"/> </td>
</tr>
</xsl:if>
<xsl:if test="Address2">
<tr>
<td class="DetailRowDataClass" width="100%"><xsl:value-of select="Address2"/> </td>
</tr>
</xsl:if>
<xsl:if test="City">
<tr>
<td class="DetailRowDataClass" width="100%"><xsl:value-of select="City"/></td>
</tr>
</xsl:if>
<xsl:if test="State">
<tr>
<td class="DetailRowDataClass" width="100%">
<xsl:value-of select="State"/>
</td>
</tr>
</xsl:if>
<xsl:if test="Country">
<tr>
<td class="DetailRowDataClass" width="100%"> <xsl:value-of select="Country"/>
</td>
</tr>
</xsl:if>
<xsl:if test="Zip">
<tr>
<td class="DetailRowDataClass" width="100%">
<xsl:value-of select="Zip"/>
</td>
</tr>
</xsl:if>
<xsl:if test="Phone">
<tr>
<td class="DetailRowDataClass" width="100%">
<xsl:value-of select="Phone"/>
</td>
</tr>
</xsl:if>
<xsl:if test="Fax">
<tr>
<td class="DetailRowDataClass" width="100%"> <xsl:value-of select="Fax"/>
</td>
</tr>
</xsl:if>
<xsl:if test="//Report/HeaderInfo/Terms">
<tr>
<td class="DetailRowTitleClass">Terms:</td>
<td class="DetailRowDataClass"><xsl:value-of select="//Report/HeaderInfo/Terms"/></td>
</tr>
</xsl:if>
</table>
</xsl:template>
<xsl:template match="Project" mode="customer-project">
<xsl:if test="Task">
<table align="center" width="70%">
<tr>
<td class="ProjectName" colspan="3"><xsl:value-of select="@Name"/> :
<xsl:value-of select="//HeaderInfo/Date/From"/> - <xsl:value-of select="//HeaderInfo/Date/To"/></td>
</tr>
<tr>
<td width="60%" class="DetailRowTitleClassCenter">Task</td>
<td width="20%" class="DetailRowTitleClassCenter">Hours</td>
<td width="20%" class="DetailRowTitleClass">Amount</td>
</tr>
<xsl:apply-templates select="Task" mode="customer-task"/>
<tr>
<td width="60%" valign="top" class="SubTotal">Sub-total: </td>
<td valign="top" class="DetailRowDataClass1"><xsl:value-of select="SubTotal/@Hours"/></td>
<td valign="top" class="DetailRowDataClass1"><xsl:value-of select="SubTotal/@Amount"/></td>
</tr>
</table>
</xsl:if>
</xsl:template>
<xsl:template match="Project/Task" mode="customer-task">
<tr>
<td width="60%" class="DetailRowDataClass"><xsl:value-of select="@Name"/></td>
<td class="DetailRowDataClass1"><xsl:value-of select="@Hours"/></td>
<td class="DetailRowDataClass1"><xsl:value-of select="@Amount"/></td>
</tr>
</xsl:template>
</xsl:stylesheet>